//
//  ScheduleCell.m
//  Japanese+
//
//  Created by Jame on 15/10/22.
//  Copyright © 2015年 SSIC. All rights reserved.
//

#import "ScheduleCell.h"
#import "ScheduleModel.h"

@implementation ScheduleCell

- (void)awakeFromNib {
    // Initialization code
}


- (void)setCellWithModel:(NSArray *)model WithIndexPath:(NSIndexPath *)index
{
    ScheduleData *data = model[index.row];
    self.titleLabel.text = data.course_name;
    self.nameLabel.text = data.mName;
    
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"HH:mm"];
    NSString *start = [dateFormatter stringFromDate:[NSDate dateWithTimeIntervalSince1970:[data.class_time integerValue]/1000]];
    NSString *end = [dateFormatter stringFromDate:[NSDate dateWithTimeInterval:60*60 sinceDate:[NSDate dateWithTimeIntervalSince1970:[data.class_time integerValue]/1000]]];
    self.timeLabel.text = [NSString stringWithFormat:@"%@-%@",start,end];
}

@end
